package com.carrie.tools;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Getter;
import lombok.Setter;

/**
 * @author XuHaiLong
 * @since 2025/3/20
 */
@Getter
@Setter
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Result {
    // 状态码
    private int code;
    // 提示信息
    private String message;
    // 数据
    private Object data;

    private String jwtToken;
    public Result() {
    }
    public Result(int code, String message, Object data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }
    public Result(int code, String message) {
        this.code = code;
        this.message = message;
    }
    public Result(int code, String message, Object data, String jwtToken) {
        this.code = code;
        this.message = message;
        this.data = data;
        this.jwtToken = jwtToken;
    }

    public static Result success(Object data) {
        return new Result(200, "success", data);
    }
}